(function ($) { "use strict"; // Gallery $(".woocommerce-product-gallery__wrapper").addClass( "vu_lightbox vu_l-gallery" ); $("body").addClass("woocommerce"); $(document).ready(function (e) { // Header $(".vu_wc-page .woocommerce-result-count") .next(".woocommerce-ordering") .andSelf() .wrapAll('
'); // Mini Cart $(".add_to_cart_button").on("click", function () { var product_name = $(this).attr("data-name"); $(".vu_wc-cart-notification") .stop(true, true) .fadeOut(400, function () { $(this).find(".vu_wc-item-name").text(product_name); }); }); $(".vu_wc-cart-notification").hover(function () { $(this).stop(true, true).fadeOut(400); }); $(".vu_wc-menu-item").hover( function () { if (!$(this).find(".vu_wc-cart-notification").is(":visible")) { $(this).find(".vu_wc-cart").stop(true, true).fadeIn(400); } }, function () { $(this).find(".vu_wc-cart").stop(true, true).fadeOut(400); } ); // Input Checkbox var vu_wc_checkbox = function ($this) { if (!$this.length || $this.prev("span.vu_input-checkbox").length > 0) { return false; } var $vu_checkbox = $("") .addClass("vu_input-checkbox") .html(''); if ($this.is(":checked")) { $vu_checkbox.addClass("checked"); } $this.hide(); $vu_checkbox.insertBefore($this); $this.on("change", function () { if ($this.is(":checked")) { $this.prev(".vu_input-checkbox").addClass("checked"); } else { $this.prev(".vu_input-checkbox").removeClass("checked"); } }); $vu_checkbox.on("click", function () { if (!$this.parent().is("label")) { $this.trigger("click"); } }); }; $('.woocommerce input[type="checkbox"]').each(function () { vu_wc_checkbox($(this)); }); // Input Radio $('.woocommerce .ywapo_input[type="radio"]:checked').trigger("change"); // YWAPO $(".woocommerce select.ywapo_input").addClass("form-control"); // Variable $(".woocommerce .variations_form .variations select").addClass( "form-control" ); // Pagination if (!$.fn.yit_infinitescroll) { $(".woocommerce-pagination ul.page-numbers") .addClass("vu_p-list list-unstyled") .removeClass("page-numbers"); $(".woocommerce-pagination") .addClass("vu_pagination") .removeClass("woocommerce-pagination"); } // Quantity var vu_wc_quantity = function () { var $vu_wc_quantity = $(".woocommerce .quantity .qty"); $vu_wc_quantity.each(function (index, value) { var $this = $(this), $parent = $this.parent(".quantity").addClass("clearfix"); if (!$parent.find(".vu_qty-button").length) { var $button = $("